import React from "react";
class Title extends React.Component
{
    constructor()
    {
        super();
        this.state = {
            message:"我是消息"
        }
    }

    changeMeaage()
    {
        this.props.handleClick();
    }

    render()
    {
        return (
            <div onClick={()=>this.changeMeaage()}>
                <h1>{this.props.title}</h1>
                <h2>{ this.state.message}</h2>
            </div>
        )
    }
}

export default Title;